/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package utilities.entities;

import entities.Match;
import entities.Prediction;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Vector;

/**
 *
 * @author olawale
 */
public class Result implements Serializable{

    public Result(AResult aresult, BResult bresult){
        this.aResult = aresult;
        this.bResult = bresult;
    }

    public Result(){

    }

    /** the side A search result*/
    public AResult aResult;
    /** the side B search result*/
    public BResult bResult;
    /** the unnatural sdate search result*/
    public UResult uResult;
    /** default calendar */
    public SCalendar dCalendar;
    /** prediction calendar */
    public SCalendar pCalendar;
    /** the current match*/
    public Match cMatch;
    /** the program assigned refNo */
    public Long refNo;
    /**the file Name of the storing the prediction*/
    public String fileName;
    /**prediction*/
    public Prediction prediction;
    
//    /** the number range result for side A*/
//    public NResult nResultA;
//    /** the number range result for side B*/
//    public NResult nResultB;
    /** the the prediction result code number*/
//    public Integer prCode;
    /** the side A compare list*/
    public List<CResult> acResults;
    /** the side B compare list*/
    public List<CResult> bcResults;
    /*add result list*/
    public List<NResult> addResult;
    /*minus result list*/
    public List<NResult> minusResult;


    public class AResult implements Serializable{
        /** the previous match*/
        public Match pmatch;
        /** the result match*/
        public Match rmatch;
        /** the search result row*/
        public Vector resultRow;
        /** the default result row*/
        public Vector defaultRow;
        /** the result row from the code sdate range*/
        public Vector cResultRow;
        /** the default result row from the code sdate range*/
        public Vector cDefaultRow;
        /** the default result row from the current match*/
        public Vector cmDefaultRow;
        /** the result row from the current match */
        public Vector cmResultRow;
        /** the search result calendar */
        public SCalendar calander;
        /** the side A date range*/
        public DateRange arange;
        /** the list of rows where matches occur */
        public RowMatch rowMatching;
    }

    public class BResult implements Serializable{
        /** the previous match*/
        public Match pmatch;
        /** the search result match*/
        public Match rmatch;
//        /** result sdate */
//        public String resultDate;
        /** the search result sdate range*/
        public DateRange brange;
        /** the search result return code sdate range */
        public DateRange crange;
        /** the search result return code sdate*/
        public Date cdate;
        /** the search result row*/
        public Vector resultRow;
        /** the default result row*/
        public Vector defaultRow;
        /** the list of rows where matches occur */
        public RowMatch rowMatching;
        /** search location */
        public String sDirection;
        public String sLocation;
        /** the the prediction result code number*/
        public Integer prCode;
    }

    public class UResult implements Serializable{
        /** */
        public List<DateRange> urange;
        /** */
        public List<Vector> resultRows;
        /** */
        public List<Match> matches;
    }

    public class NResult implements Serializable{
        /** the number that was added or subracted*/
        public int number;
        /**the resulting Match*/
        public Match rMatch;
        /**the resulting row*/
        public Vector row;
    }

    public class CResult implements Serializable{
        /**Date Range that produces the match*/
        public DateRange dateRange;
        /**The resultant Match */
        public Match match;
    }

    public class RowMatch implements Serializable{
        /** the row number*/
        public int row;
        /** the string date*/
        public String sdate;
        /** column position matches as key and column number as values*/
        public HashMap<Integer, Integer> colVal;
    }

}
